﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Model.Models.Cliente>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2><center>Lista de clientes<center/></h2>
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" media="screen" />
<p>
    
</p>
<table>
    <tr>
        <th>
            Nome
        </th>
        <th>
            Cpf
        </th>
        <th>
            Email
        </th>
        <th>
            Senha
        </th>
        <th>
            Telefone
        </th>
        <th>
            Cidade
        </th>
        <th>
            Estado
        </th>
        <th></th>
    </tr>

<% foreach (var item in Model) { %>
    <tr>
        <%: Html.HiddenFor(modelItem => item.Id_Cliente) %>
        
        <td>
            <%: Html.DisplayFor(modelItem => item.Nome) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Cpf) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Email) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Senha) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Telefone) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Cidade) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Estado) %>
        </td>
        <td>
            <%: Html.ActionLink("Editar", "Edit", new { id=item.Id_Cliente }) %> |
            <%: Html.ActionLink("Detalhes", "Details", new {  id=item.Id_Cliente }) %> |
            <%: Html.ActionLink("Deletar", "Delete", new {  id=item.Id_Cliente  }) %>
        </td>
    </tr>
<% } %>

</table>
<br/>
<br/>
<%: Html.ActionLink("Cadastrar cliente", "Create") %>
</asp:Content>
